package logic

import (
	"context"
	"go.uber.org/zap"
	"smart-health-platforms/pkg"
	"user_srv/internal/svc"
	"user_srv/model"

	"user_srv/user"

	"github.com/zeromicro/go-zero/core/logx"
)

type CollectBatchLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCollectBatchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CollectBatchLogic {
	return &CollectBatchLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 批量删除
func (l *CollectBatchLogic) CollectBatch(in *user.CollectBatchRequest) (*user.CollectBatchResponse, error) {
	err := model.BatchDeleteCollections(in.CollectionId)
	if err != nil {
		pkg.Error("失败", zap.Error(err))
		return nil, err
	}
	return &user.CollectBatchResponse{
		Msg: "成功",
	}, nil
}
